//
//  ForgetPassWordController.m
//  PaiQuan
//
//  Created by Mac on 16/7/16.
//  Copyright © 2016年 huigu. All rights reserved.
//

#import "ForgetPassWordController.h"

@interface ForgetPassWordController ()<UITextFieldDelegate>
//+86按钮

@property(nonatomic,strong)UIButton *numberBtn;
//容器
@property(nonatomic,strong)UIView *contentView;

@property(nonatomic,strong)UIView *lineView1;
@property(nonatomic,strong)UIView *lineView2;

@property(nonatomic,strong)UITextField *IphoneTF;
@property(nonatomic,strong)UITextField *messageTF;
@property(nonatomic,strong)UITextField *passWordTF;

@property(nonatomic,strong)UIButton *loginBtn;
@end

@implementation ForgetPassWordController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titleView.title = @"忘记密码";
    self.view.backgroundColor = PQ_COLOR_DarkGray;
    [self.titleView.btnBack setTitle:@"返回" forState:UIControlStateNormal];
    
    [self setUPUI];
    [self setUPCon];
   
}
-(void)setUPUI{
    [self.view addSubview:self.contentView];
    [self.contentView addSubview:self.numberBtn];
    [self.contentView addSubview:self.lineView1];
    [self.contentView addSubview:self.IphoneTF];
    [self.contentView addSubview:self.lineView2];
    
    [self.contentView addSubview:self.messageTF];
    [self.view addSubview:self.passWordTF];
    [self.view addSubview:self.loginBtn];

    
}
-(void)setUPCon{
    [self.contentView makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleView.bottom).offset(RATIO(94));
        make.left.equalTo(self.view.left).offset(RATIO(74));
        make.width.equalTo(RATIO(602));
        make.height.equalTo(RATIO(180));
    }];
    [self.numberBtn makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.top).offset(RATIO(20));
        make.left.equalTo(self.contentView.left).offset(RATIO(10));
        make.width.equalTo(RATIO(80));
        make.height.equalTo(RATIO(40));
        
    }];
    [self.lineView1 makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(RATIO(2));
        make.height.equalTo(RATIO(60));
        make.left.equalTo(self.contentView.left).offset(RATIO(100));
        make.top.equalTo(self.contentView.top).offset(RATIO(15));
    }];
    [self.IphoneTF makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.lineView1.right).offset(RATIO(40));
        make.centerY.equalTo(self.lineView1.centerY);
        make.height.equalTo(RATIO(50));
        make.right.equalTo(self.contentView.right);
    }];
    [self.lineView2 makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(RATIO(582));
        make.height.equalTo(RATIO(RATIO(2)));
        make.left.equalTo(self.contentView.left).offset(RATIO(10));
        make.top.equalTo(self.contentView.top).offset(RATIO(90));
    }];
    [self.messageTF makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(RATIO(40));
        make.top.equalTo(self.lineView2).offset(RATIO(20));
        make.height.equalTo(RATIO(50));
        make.right.equalTo(self.contentView.right);

    }];
    [self.passWordTF makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.bottom).offset(RATIO(20));
        make.left.equalTo(self.view.left).offset(RATIO(74));
        make.width.equalTo(RATIO(602));
        make.height.equalTo(RATIO(90));
    }];
    [self.loginBtn makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.passWordTF.bottom).offset(RATIO(44));
        make.centerX.equalTo(self.view.centerX);
        make.width.equalTo(RATIO(602));
        make.height.equalTo(RATIO(90));
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(UIButton*)numberBtn{
    if (!_numberBtn) {
        _numberBtn = [[UIButton alloc] init];
        [_numberBtn setTitle:@"+86" forState:UIControlStateNormal];
        [_numberBtn setTitleColor:RGBA(255, 255, 255, 0.7f) forState:UIControlStateNormal];
        _numberBtn.titleLabel.font = FONT(15);
        _numberBtn.backgroundColor = PQ_COLOR_BLACK;
    }
    
    return _numberBtn;
    
}
-(UIView*)contentView{
    if (!_contentView) {
        _contentView = [[UIView alloc] init];
        _contentView.backgroundColor = PQ_COLOR_BLACK;
        _contentView.layer.cornerRadius =RATIO(8);
        _contentView.layer.masksToBounds = YES;
    }
    return _contentView;
    
}
-(UIView*)lineView1{
    if (!_lineView1) {
        _lineView1 = [[UIView alloc] init];
        _lineView1.backgroundColor = PQ_COLOR_YELLOW;
        _lineView1.layer.cornerRadius =RATIO(10);
        _lineView1.layer.masksToBounds = YES;
    }
    return _lineView1;
    
}
-(UIView*)lineView2{
    if (!_lineView2) {
        _lineView2 = [[UIView alloc] init];
        _lineView2.backgroundColor = PQ_COLOR_YELLOW;
        _lineView2.layer.cornerRadius =RATIO(10);
        _lineView2.layer.masksToBounds = YES;
    }
    return _lineView2;
    
}
-(UITextField *)IphoneTF{
    if (!_IphoneTF) {
        _IphoneTF = [[UITextField alloc] init];
        _IphoneTF.backgroundColor = [UIColor clearColor];
        _IphoneTF.delegate = self;
        //_account.placeholder=[NSString stringWithFormat:@"Email"];
        UIColor *color = [UIColor whiteColor];
        _IphoneTF.attributedPlaceholder = [[NSAttributedString alloc]
                                           initWithString:@"请输入您的手机号码"
                                           attributes:@{NSForegroundColorAttributeName : color}];
        _IphoneTF.textColor = [UIColor grayColor];
        _IphoneTF.font = FONT(15);
        _IphoneTF.userInteractionEnabled = YES;
        
        _IphoneTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _IphoneTF.adjustsFontSizeToFitWidth = YES;
        [_IphoneTF addTarget:self
                      action:@selector(textFieldDidChange:)
            forControlEvents:UIControlEventEditingChanged];
        _IphoneTF.keyboardType = UIKeyboardTypeNumberPad;
        _IphoneTF.returnKeyType = UIReturnKeyGo;
        
        
    }
    return _IphoneTF;
    
}
-(UITextField *)messageTF{
    if (!_messageTF) {
        _messageTF = [[UITextField alloc] init];
        _messageTF.backgroundColor = [UIColor clearColor];
        _messageTF.delegate = self;
        //_account.placeholder=[NSString stringWithFormat:@"Email"];
        UIColor *color = [UIColor whiteColor];
        _messageTF.attributedPlaceholder = [[NSAttributedString alloc]
                                           initWithString:@"请输入短信验证码"
                                           attributes:@{NSForegroundColorAttributeName : color}];
        _messageTF.textColor = [UIColor grayColor];
        _messageTF.font = FONT(15);
        _messageTF.userInteractionEnabled = YES;
        
        _messageTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _messageTF.adjustsFontSizeToFitWidth = YES;
        [_messageTF addTarget:self
                      action:@selector(messageTextFieldDidChange:)
            forControlEvents:UIControlEventEditingChanged];
        _messageTF.keyboardType = UIKeyboardTypeNumberPad;
        _messageTF.returnKeyType = UIReturnKeyGo;
        
    }
    return _messageTF;
    
}
-(UITextField *)passWordTF {
    if (!_passWordTF) {
        _passWordTF = [[UITextField alloc] init];
        _passWordTF.backgroundColor = [UIColor clearColor];
        _passWordTF.delegate = self;
        //_account.placeholder=[NSString stringWithFormat:@"Email"];
        UIColor *color = [UIColor whiteColor];
        _passWordTF.attributedPlaceholder = [[NSAttributedString alloc]
                                            initWithString:@"请设置您的密码"
                                            attributes:@{NSForegroundColorAttributeName : color}];
        _passWordTF.textColor = [UIColor grayColor];
        _passWordTF.backgroundColor = PQ_COLOR_BLACK;
        _passWordTF.font = FONT(15);
        _passWordTF.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,RATIO(40) , 0)];
          _passWordTF.leftViewMode = UITextFieldViewModeAlways;
        _passWordTF.userInteractionEnabled = YES;
        _passWordTF.layer.cornerRadius = RATIO(8);
        _passWordTF.layer.masksToBounds = YES;
        _passWordTF.clearButtonMode = UITextFieldViewModeWhileEditing;
        _passWordTF.adjustsFontSizeToFitWidth = YES;
        [_passWordTF addTarget:self
                       action:@selector(messageTextFieldDidChange:)
             forControlEvents:UIControlEventEditingChanged];
        _passWordTF.keyboardType = UIKeyboardTypeNumberPad;
        _passWordTF.returnKeyType = UIReturnKeyGo;
        
    }
    return _passWordTF;
    
}
-(UIButton*)loginBtn{
    if (!_loginBtn) {
        _loginBtn = [[UIButton alloc] init];
        [_loginBtn setBackgroundColor:RGB(158, 129, 67)];
        [_loginBtn setTitle:@"进入牌圈" forState:UIControlStateNormal];
        [_loginBtn setTitleColor: [UIColor whiteColor] forState:UIControlStateNormal];
        _loginBtn.layer.cornerRadius = RATIO(8);
        _loginBtn.layer.masksToBounds = YES;
        _loginBtn.titleLabel.font = FONT(17);
        [_loginBtn addTarget:self
                      action:@selector(actionLogin:)
            forControlEvents:UIControlEventTouchUpInside];
    }
    return _loginBtn;
}


#pragma mark -- 按钮的点击事件
-(void)textFieldDidChange:(UITextField*)sender{
    
    
    
}
-(void)messageTextFieldDidChange:(UITextField*)sender{
    
    
}
-(void)actionLogin:(UIButton*)sender{
    
    
    
}


@end
